import LayoutIndex from "@/pages/layout/index.vue";
import Main from "@/pages/layout/main.vue";
import ReportManagement from "@/pages/reportManagement.vue";
import TaskManagement from "../../pages/taskManagement.vue";
import TaskDistribution from "@/pages/taskDistribution.vue";
import Usermanagement from "@/pages/usermanagement.vue";
import PersonalInformation from "@/pages/personalInformation.vue";
import editTaskPages from "@/pages/editTaskPages.vue";
import PasswordReset from "@/pages/userPages/passwordReset.vue";

import Login from "@/pages/login.vue";
import Register from "@/pages/register.vue";

// 用户页面组件
import UserMain from "@/pages/layout/user/userMain.vue";
import UserLayoutIndex from "@/pages/layout/user/userIndex.vue";
import UserHome from "@/pages/userPages/userHome.vue";
import NewTask from "@/pages/userPages/newTask.vue";
import PersonalInformationuser from "@/pages/userPages/personalInformationuser.vue";  
import userEditTaskPages from '../../pages/userPages/userEditTaskPages.vue';
import userEdit from '../../pages/userPages/userEdit.vue';
import userMyMessage from '@/pages/userPages/userMyMessage.vue'
import userAllTask from "../../pages/userPages/userAllTask.vue";

export const routes = [
    {   path: '/', //管理员
        redirect:'/slideDown' ,//切换到管理员页面的时候，可修改当前路径为想要看的页面
        component:LayoutIndex,//页面根组件
        meta:{name:'系统管理员',path:'userIndex'},
        children:[
            {
                path:'/main',component:Main,//主体
            
                children:[
                    {path:"/editTaskPages",name:"editTask",component:editTaskPages,meta:{title:"编辑任务信息"}},//编辑任务信息
                    {path:'/taskManagement',component:TaskManagement,meta:{title:"任务管理"}},//任务管理
                    {path:'/reportManagement',component:ReportManagement,meta:{title:"报表管理"}},//报表管理
                     {path:"/taskDistribution",component:TaskDistribution,meta:{title:"任务派发"}},//任务派发
                     {path:"/usermanagement",component:Usermanagement,meta:{title:"用户管理"}},//用户管理
                     {path:"/personalInformation",component:PersonalInformation,meta:{title:"个人信息"}},//个人信息
                     {path:"/passwordReset/:userId",name:"passwordReset",component:PasswordReset,meta:{title:"密码重置"}},//密码重置
                     {path:"/userEdit/:userId",name:"userEdit",component:userEdit,meta:{title:"用户编辑"}}//用户编辑
                ]
            },
        ]
     },
     {  path: '/userIndex', //用户
        redirect:'/userHome',//切换到用户页面的时候，可修改当前路径为想要看的页面
        component:UserLayoutIndex,//页面根组件
        meta:{name:'普通用户',path:'/'},
        children:[
            {
                path:'/userMain',component:UserMain,//主体
                children:[
                    {path:'/userHome',component:UserHome,meta:{title:"首页"}},//首页
                    {path:'/newTask',component:NewTask,meta:{title:"新建任务"}},//新建任务
                    {path:'/personalInformationuser',component:PersonalInformationuser,meta:{title:"个人信息"}},//个人信息
                    {path:'/usereditTaskPages',component:userEditTaskPages,meta:{title:"编辑任务"}},//编辑任务
                    {path:'/userMyMessage',component:userMyMessage,meta:{title:"我的消息"}},//我的消息
                    {path:"/userAllTask",component:userAllTask,meta:{title:"全部任务"}}//全部任务
                ]
            }
        ]
     },
     {
        path: '/:pathMatch(.*)*', // 匹配所有未定义的路由
        name: 'Error404',
        component: import("@/pages/404.vue")
      },
     {path:"/404",component:import("@/pages/404.vue")},
     { path: '/login', name:"Login",component:Login},//登录
     { path: '/register', component:Register},//注册
     {path:"/slideDown",component:()=>import("../../pages/slideDown.vue")}//滑动解锁
  ] 
